package petshop.agronunes.negocio;

import java.util.List;

import petshop.agronunes.dao.AnimalDAO;
import petshop.agronunes.entidade.Animal;


public class AnimalBLL {
	
	public Integer insert(Animal animal) throws Exception {
		try {
			return new AnimalDAO().insert(animal);
		} catch (Exception e) {
			throw new Exception(e);
		}
	}
	
	public void update(Animal animal) throws Exception {
		try {
			new AnimalDAO().update(animal);
		} catch (Exception e) {
			throw new Exception(e);
		}
	}
	
	public Animal GetById(Integer id) throws Exception {
		try {
			return new AnimalDAO().GetById(id);
		} catch (Exception e) {
			throw new Exception(e);
		}
	}
	
	public void delete(Animal animal) throws Exception {
		try {
			new AnimalDAO().delete(animal);
		} catch (Exception e) {
			throw new Exception(e);
		}
	}
	
	public List<Animal> getAll() throws Exception {
		try {
			return new AnimalDAO().getAll();
		} catch (Exception e) {
			throw new Exception(e);
		}
	}
}
